UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/hkSRXNbut8tOTT/hPLvCPQnBhMdwXAhSq0IJ9u3yOU='
WHERE
key_id = 'fe642a2f52e72b1bc7730417bd6f9893788c945a4f4928c1f37b302c2a6f1f6e'
AND (
token = '/hkSRXNbut8tOTT/hPLvCPQnBhMdwXAhSq0IJ9u3yOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)