UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '55EuIsX8bU0QY0nT0Z0x0v4wZhVOuYYBkYh0XVl7ZRQ='
WHERE
key_id = '2c080b724403865a165a764452cf2e5d01c5f72b5e6cfb263e08ef0771a322c0'
AND (
token = '55EuIsX8bU0QY0nT0Z0x0v4wZhVOuYYBkYh0XVl7ZRQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)