UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c7El7RJSUhhQkT0PExTWLA4TFKWZ7GqLDYcZGbUkab0='
WHERE
key_id = '19f1818aab68eb98b4772c5487345a5116df57d499db57fe06d367bb996b0aeb'
AND (
token = 'c7El7RJSUhhQkT0PExTWLA4TFKWZ7GqLDYcZGbUkab0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)