UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FJ/+n7FwRW+9vkaOBnQRgKagfiVbFvQe3ZdprRc6czY='
WHERE
key_id = 'b6e47643da0a35c50fb95bf9d0d04f8bb62324f778bcc1bbf042aa58a6ef8349'
AND (
token = 'FJ/+n7FwRW+9vkaOBnQRgKagfiVbFvQe3ZdprRc6czY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)