UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ynHNMyN5GwBxLQMMmjM3H58Dud7K/1UVe5ulTQYu4xU='
WHERE
key_id = 'b5a708c781464e9d40bf265d58e4cca10341cef2f2c6ee410da01835c0414fd4'
AND (
token = 'ynHNMyN5GwBxLQMMmjM3H58Dud7K/1UVe5ulTQYu4xU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)