UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J1n9IGiPqlevIrSUHLA6G7o94ITxulKu2G9W3oLxCJc='
WHERE
key_id = '6a2c4b742d5ef2874bf5448396ae344e563b91b505fb0d5c0abdbf224bc22f03'
AND (
token = 'J1n9IGiPqlevIrSUHLA6G7o94ITxulKu2G9W3oLxCJc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)