UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PZlkGVepGh+Fp04z7qHmpE0QMF/+npE2mufrceZZy6A='
WHERE
key_id = '564c5ddd1a8b68aeec52b5e95e8293ded07944bbc6d58b0f1b8c26851bb25777'
AND (
token = 'PZlkGVepGh+Fp04z7qHmpE0QMF/+npE2mufrceZZy6A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)