UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pj1mt7aGlzaaGWA80T+pF6vq3cb/cyzvsWdXykgvvxk='
WHERE
key_id = '19fec70a83de206c3ffeab59caf9e0c7428aa21c073d88663c97eaa9f9a4f59b'
AND (
token = 'pj1mt7aGlzaaGWA80T+pF6vq3cb/cyzvsWdXykgvvxk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)