UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7HebQid/SoojmabsaYqTOv0YAOrZ58LVT1KBg+LAcaY='
WHERE
key_id = '5a76e01323c2e51f7ba9a7c1b2b20d3f450c9ea2a68b7d128f73386dc28c1ec0'
AND (
token = '7HebQid/SoojmabsaYqTOv0YAOrZ58LVT1KBg+LAcaY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)