UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mY1AwzhSIZgG1eLaQbX/MPrAbg+6r7u8439RDUzJomg='
WHERE
key_id = 'ef498b9f2f67d85c2dc89491384f7c88645d2157d9737de900a0277da9697e1a'
AND (
token = 'mY1AwzhSIZgG1eLaQbX/MPrAbg+6r7u8439RDUzJomg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)