UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'na/0O8LTJ1t1HyZJx5yeIYlc/H8kXIfpLFsaTwRdYWg=' 
WHERE 
  key_id = 'd7c0b09825158f590781b6416e81a6f968e8e9ed88a1c968b756e9d5f13879c4' 
  AND (
    token = 'na/0O8LTJ1t1HyZJx5yeIYlc/H8kXIfpLFsaTwRdYWg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043