UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bHuj0mRCDe5vc/jeY6oxGVIWjddtvdspbyxqSQZDZ2s='
WHERE
key_id = 'ce518ed36d4931b664ba93a3f4d8408d445dfd9e3854676534c2d53f669278ab'
AND (
token = 'bHuj0mRCDe5vc/jeY6oxGVIWjddtvdspbyxqSQZDZ2s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)