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