UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y2PEJXF2aKi017u283nub62ek3RmTNTSWqpAxIGDJik='
WHERE
key_id = 'e788a27a30afaab663aa486e1a3b2686097b3a973bb0986a6241dba7a8537954'
AND (
token = 'Y2PEJXF2aKi017u283nub62ek3RmTNTSWqpAxIGDJik='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)