UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QulJ2mWCjU+yWeGG+oGgJZDeh6tXXzAutu1eI7BcUJo='
WHERE
key_id = 'e7ef7eea54c57101268f1cc47e652d6597c345259407910b24aa148ecddd7145'
AND (
token = 'QulJ2mWCjU+yWeGG+oGgJZDeh6tXXzAutu1eI7BcUJo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)