UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DEeNDHpnpFmjW9FWOYnBKnhEpSKCIePUpcr3HEsTNk0='
WHERE
key_id = '4ae6bb2aaad2caf0386d36f46c9cdaed6546cff2d3e10cc0f172b3789f6720cd'
AND (
token = 'DEeNDHpnpFmjW9FWOYnBKnhEpSKCIePUpcr3HEsTNk0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)