UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0a9l6SvNh4dqI+ZDuZGczZiVDxGjPVbUNoplXzIS2iw='
WHERE
key_id = 'c93bb4fe4cd33a32b39fa2e8efb626e582849fe1a616280812bf01fc1cc4509a'
AND (
token = '0a9l6SvNh4dqI+ZDuZGczZiVDxGjPVbUNoplXzIS2iw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)