UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fx7Cynrcr0sCYvaI8GfQOZLqPdkmSfYNI/4oBqbl0ys='
WHERE
key_id = '3d53f5fdedf8ca8778840e41cc125d225c0e3f759502fb777552218a8ffaef8b'
AND (
token = 'fx7Cynrcr0sCYvaI8GfQOZLqPdkmSfYNI/4oBqbl0ys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)