UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+QOzXNvVd1/bO6gjaKf3ikpIgOON7H65fSVabPnBUuY='
WHERE
key_id = '02f66fc50893c8cf16be4741afffd1c9e38dd00ea5fe8427be61dca82b046a4b'
AND (
token = '+QOzXNvVd1/bO6gjaKf3ikpIgOON7H65fSVabPnBUuY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)