UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F+vuFw4aJ07gnAjEiE1IVh0WxpmZlF6pICrgnDGQoLg=' 
WHERE 
  key_id = '524a936246000dc4a4aa5b82141ab5281a38c5c894f5862b122605dfa9c84b75' 
  AND (
    token = 'F+vuFw4aJ07gnAjEiE1IVh0WxpmZlF6pICrgnDGQoLg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041