UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ludefMeqd97vPoYN59DTzssLwWInZIlE9ek6PonUPok='
WHERE
key_id = '5f3827e7e1dcf5111954249999f799010158051e562a6f823aceb251fd480dfa'
AND (
token = 'ludefMeqd97vPoYN59DTzssLwWInZIlE9ek6PonUPok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)