UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kkoDkVIvJmjQyU8xB27JZ5Y9OLzAVI/E5C8+sJLs0dU='
WHERE
key_id = '1f82364c275dddf56a134473bea82f49ad0b21439638e0888b2e4959a52c6257'
AND (
token = 'kkoDkVIvJmjQyU8xB27JZ5Y9OLzAVI/E5C8+sJLs0dU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)