UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i3qu4wjKCIqC9Bc8xUtC0x3D6JQejiObZ9MXLw0u5zY=' 
WHERE 
  key_id = '441a2eed6281840abb0f74f8dba440535d1bb9aafe5bb8ffdd5f2f1560aace60' 
  AND (
    token = 'i3qu4wjKCIqC9Bc8xUtC0x3D6JQejiObZ9MXLw0u5zY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019