UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JNoIY07h7McNrsirJZ7EMar1GIfto8A4a+VxGqW6j5Y='
WHERE
key_id = '202a5cbcb3bdb69821e9edcaf0812931ee9c596331fec4154319b6bd9dd4cc74'
AND (
token = 'JNoIY07h7McNrsirJZ7EMar1GIfto8A4a+VxGqW6j5Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)