UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Kezf8pVvZphVbhul85r+mQdd7QcnfvNrxvo/8t69TlQ='
WHERE
key_id = 'ff2839a1e18813221049ddfb9b56cea475b22dfecdd2e24d8a9401bcca1f2bbd'
AND (
token = 'Kezf8pVvZphVbhul85r+mQdd7QcnfvNrxvo/8t69TlQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)