UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nLhXEbMhNRPmXsF83U9M/J6qhHGn3dTHR/7y/huqWKc=' 
WHERE 
  key_id = 'a0652eebaa9f00a14afa7e3d7526dc68be5b6f3532e3a98689b47c4ce47a7751' 
  AND (
    token = 'nLhXEbMhNRPmXsF83U9M/J6qhHGn3dTHR/7y/huqWKc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033