UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wHHxtLp8xNEp54uEwDix9grQHuKbOPEdYipSopQ/XXo=' 
WHERE 
  key_id = '8bce6d7cae84730cc926956e5cd4f3e1b8710e592ae1087ff20d363fc9cad4f6' 
  AND (
    token = 'wHHxtLp8xNEp54uEwDix9grQHuKbOPEdYipSopQ/XXo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017