UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x5GBPHhG/ucfx+3ITpg21bZIeETElWvL3FaIlFBLHh8='
WHERE
key_id = 'f1f9888710a52195cd86d1d81cc88fad7dc5eede7ed277a39f94e5098d4e490b'
AND (
token = 'x5GBPHhG/ucfx+3ITpg21bZIeETElWvL3FaIlFBLHh8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)