UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dLOuxBsER2e5EvGozGQMUCAlc6uexjiy+1axPLUbCks='
WHERE
key_id = '2793e2533cb62157d87336f57f9fe53fdd6de2de6f3fe765bb99df3623eb27c4'
AND (
token = 'dLOuxBsER2e5EvGozGQMUCAlc6uexjiy+1axPLUbCks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)