UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5lBJ1j4SJnkXrrtTvcASzO2F9XyXTPeKscniMhXQTz4=' 
WHERE 
  key_id = 'a37d59ac87dd86e8bbcc2aa21b96a9edc309a7cd4e1a0a6a4d48db1b8b5a0d24' 
  AND (
    token = '5lBJ1j4SJnkXrrtTvcASzO2F9XyXTPeKscniMhXQTz4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036